//
//  RACSubjectViewController.m
//  RACDemo
//
//  Created by he.xu on 2017/12/29.
//  Copyright © 2017年 mingxin.ji. All rights reserved.
//

#import "RACSubjectViewController.h"

@interface RACSubjectViewController ()

@end

@implementation RACSubjectViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    self.title = @"RACSubject";
    
    
    // 创建信号
    RACSubject *subject = [RACSubject subject];
    
    // 订阅信号
    [subject subscribeNext:^(id x) {
        NSLog(@"发送过来的数据->%@",x);
    }];
    
    // 发送数据
    [subject sendNext:@"RACSubject 发送数据"];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
